package com.itheima.config;

import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import org.springframework.context.annotation.Bean;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

/**
 * @author huyoufu <https://github.com/huyoufu>
 * @TIME 2020-08-06 14:39
 * @description
 */
public class RedisConfig {

    @Bean
    public JedisPool createJedisPool(){


        GenericObjectPoolConfig config=new JedisPoolConfig();


        //创建这个jedis连接池代码
        JedisPool pool = new JedisPool(config,"localhost",6379);


        return pool;

    }
}
